<span ng-show="type==1"><h3><B>添加banner</B></h3></span>
<span ng-show="type==2"><h3><B>添加话题公告</B></h3></span>
<div ng-show="type==1">
    <label class="control-label">banner图片：</label>
    <input type="file"
           onchange="angular.element(this).scope().selectFile(this.files)" accept="image/*">
</div>
<div ng-show="type==2">
    <label class="control-label">话题公告内容：</label>
    <input class="form-control" type="text" placeholder="内容" ng-model="message">
</div>

<br>
<label class="control-label">选择小区：</label>
<label> <input style="zoom:1.8;margin-left: 10px;vertical-align:middle" ng-model="ck"
               type="checkbox" ng-click="allCheck(ck)"/>全选</label>
<br>
<br>
<label ng-repeat="m in communityLabelList.data">
    <input type="checkbox" style="zoom:1.8;margin-left: 10px;vertical-align:middle" ng-model="chk"
           ng-click="toggle(chk,m.objId)" name="chkItem"
            /> {{m.communityName}}
</label>

<br>
<div class="tabbable" id="tabs-932122" style="margin-top: 40px">
    <!-- Only required for left/right tabs -->

    <ul class="nav nav-tabs">
        <li class="active"><a data-toggle="tab" href="#tab_question" ng-click="initCurrentPage()">话题</a></li>
        <li><a data-toggle="tab" href="#tab_activity" ng-click="initCurrentPage()">邻里活动</a></li>
        <li><a data-toggle="tab" href="#tab_topic" ng-click="initCurrentPage()">专题</a></li>
        <li><a data-toggle="tab" href="#tab_notice" ng-click="initCurrentPage()">公告</a></li>
        <li><a data-toggle="tab" href="#tab_lottery" ng-click="initCurrentPage()">抽奖活动</a></li>
        <li><a data-toggle="tab" href="#tab_iphone" ng-click="initCurrentPage()">抽iPhone6</a></li>
    </ul>
    <paging>
        <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
            on-select-page="selectPage(page)">
            <li ng-class="{disabled: noPrevious()}"><a ng-click="selectPrevious()">&laquo;</a>

            </li>
            <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                    ng-click="selectPage(page)">{{page}}</a>

            </li>
            <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

            </li>
        </ul>
    </paging>
    <div class="tab-content">
        <div class="tab-pane active" id="tab_question">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>问题描述</th>
                    <th>创建者</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionList">
                    <td width="100">{{question.community.communityName}}</td>
                    <td width="400">{{question.desc}}</td>
                    <td width="200">{{question.createdBy.nickName}}</td>
                    <td width="200">{{question.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(question.objId,1,question.createdBy.objId)">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>

                </tbody>
            </table>

        </div>

        <div class="tab-pane" id="tab_activity">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标题</th>
                    <th>描述</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="activity in activityList">

                    <td width="200">{{activity.community.communityName}}</td>
                    <td width="400">{{activity.title}}</td>
                    <td>{{activity.desc}}</td>
                    <td width="200">{{activity.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(activity.objId,6,activity.createdBy.objId)">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane" id="tab_topic">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="topic in topicList">

                    <td width="200">
                        <div ng-repeat="c in topic.community">
                            {{c.communityName}}
                        </div>
                    </td>
                    <td width="400">{{topic.title}}</td>
                    <td width="200">{{topic.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(topic.objId,4,null,topic.url,topic.title)">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane" id="tab_notice">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="notice in noticeList">

                    <td width="200">
                        <div ng-repeat="c in notice.community">
                            {{c.communityName}}
                        </div>
                    </td>
                    <td width="400">{{notice.title}}</td>
                    <td width="200">{{notice.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(notice.objId,2,null,notice.url,notice.title)">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="tab-pane" id="tab_lottery">
            <table class="table">
                <thead>
                <tr>
                    <th>活动名称</th>
                    <th>活动描述</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="lottery in lotteryList">

                    <td width="200">
                        {{lottery.activity_name}}
                    </td>
                    <td width="400">{{lottery.activity_desc}}</td>
                    <td width="200">{{lottery.begin_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="200">{{lottery.end_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(lottery.id,3,null,lottery.url,'老虎机抽奖')">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="tab-pane" id="tab_iphone">
            <table class="table">
                <thead>
                <tr>
                    <th>活动名称</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="lottery in iphoneList">
                    <td width="200">
                        {{lottery.lotteryName}}
                    </td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="addBanner(lottery.objId,3,null,lottery.url,'抽奖号抽奖')">
                            <span ng-show="type == 1">添加banner</span>
                            <span ng-show="type == 2">添加话题公告</span>
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

    </div>
</div>


<script>
    $(function () {
        $('#tabs-932122 a').click(function (e) {
            e.preventDefault();//阻止a链接的跳转行为
            $(this).tab('show');//显示当前选中的链接及关联的content
        })
    })
</script>